/*
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
*/

/* Fixed Data in ROM - Field and Curve parameters */

var ROM_CURVE_ANSSI,
  ROM_CURVE_BLS383,
  ROM_CURVE_BLS24,
  ROM_CURVE_BLS48,
  ROM_CURVE_BLS381,
  ROM_CURVE_BLS461,
  ROM_CURVE_FP256BN,
  ROM_CURVE_FP512BN,
  ROM_CURVE_BN254,
  ROM_CURVE_BN254CX,
  ROM_CURVE_BRAINPOOL,
  ROM_CURVE_C25519,
  ROM_CURVE_C41417,
  ROM_CURVE_ED25519,
  ROM_CURVE_GOLDILOCKS,
  ROM_CURVE_HIFIVE,
  ROM_CURVE_NIST256,
  ROM_CURVE_NIST384,
  ROM_CURVE_NIST521,
  ROM_CURVE_NUMS256E,
  ROM_CURVE_NUMS256W,
  ROM_CURVE_NUMS384E,
  ROM_CURVE_NUMS384W,
  ROM_CURVE_NUMS512E,
  ROM_CURVE_NUMS512W,
  ROM_CURVE_SECP256K1;

ROM_CURVE_ANSSI = function() {
  var ROM_CURVE_ANSSI = {
    // ANSSI curve

    CURVE_Cof_I: 1,
    CURVE_A: -3,
    CURVE_B_I: 0,
    CURVE_B: [
      0x7bb73f,
      0xed967b,
      0x803075,
      0xe4b1a1,
      0xec0c9a,
      0xc00fdf,
      0x754a44,
      0xd4aba,
      0x28a930,
      0x3fca54,
      0xee35,
    ],
    CURVE_Order: [
      0xd655e1,
      0xd459c6,
      0x941ffd,
      0x40d2bf,
      0xdc67e1,
      0x435b53,
      0xe8ce42,
      0x10126d,
      0x3ad58f,
      0x178c0b,
      0xf1fd,
    ],
    CURVE_Gx: [
      0x8f5cff,
      0x7a2dd9,
      0x164c9,
      0xaf98b7,
      0x27d2dc,
      0x23958c,
      0x4749d4,
      0x31183d,
      0xc139eb,
      0xd4c356,
      0xb6b3,
    ],
    CURVE_Gy: [
      0x62cfb,
      0x5a1554,
      0xe18311,
      0xe8e4c9,
      0x1c307,
      0xef8c27,
      0xf0f3ec,
      0x1f9271,
      0xb20491,
      0xe0f7c8,
      0x6142,
    ],
  };
  return ROM_CURVE_ANSSI;
};

ROM_CURVE_BLS383 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_BLS383 = {
    // BLS383 Curve
    // Base Bits= 23

    CURVE_Cof_I: 0,
    CURVE_A: 0,
    CURVE_B_I: 15,
    CURVE_B: [0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Order: [
      0x3c0001,
      0x33d7fd,
      0x5cec82,
      0x9069c,
      0x5f095a,
      0x703bc0,
      0x5a62c,
      0x2200e4,
      0x3809c0,
      0x1801,
      0x8006,
      0x8,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Gx: [
      0x734573,
      0x6e7210,
      0x11e311,
      0x1fa3b8,
      0x5dbf08,
      0x688b8a,
      0x12bc78,
      0x43dd6c,
      0x742c2f,
      0x6d6103,
      0x4c767d,
      0x6d8287,
      0x74052d,
      0x1c706b,
      0x5e7b39,
      0x5d2adc,
      0x41fc,
    ],
    CURVE_Gy: [
      0x3f224,
      0x2cbd00,
      0x7484b4,
      0x43fcc7,
      0x7d49ec,
      0x25bbca,
      0x2b7ad3,
      0x29854a,
      0x449107,
      0xcd76c,
      0x7436b7,
      0x6236cc,
      0x1cdc31,
      0x495d,
      0x33ecc0,
      0xb393a,
      0x68f,
    ],

    CURVE_Bnx: [
      0x1200,
      0x2,
      0x40020,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cof: [
      0x169eab,
      0x2ac2aa,
      0x7ed541,
      0x555df,
      0x2aac00,
      0xaab,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cru: [
      0x2ac2a9,
      0x4ea05d,
      0x4b730d,
      0x16fb2e,
      0x5f681a,
      0x683784,
      0xd37a8,
      0x2917a5,
      0x715ce2,
      0x69b7ba,
      0x15114,
      0x4a43a3,
      0x34406e,
      0x1408b5,
      0x2adbad,
      0x2b4ab2,
      0x5565,
    ],
    CURVE_Pxa: [
      0x7f2d86,
      0x676c5a,
      0x7850f2,
      0x4ae8e9,
      0x7dab67,
      0x65dd03,
      0x3d5895,
      0x3f8e48,
      0x725bd4,
      0x10a5aa,
      0xc9407,
      0xf3a32,
      0x967cb,
      0x180f32,
      0x7b00fa,
      0x691203,
      0x634,
    ],
    CURVE_Pxb: [
      0x52de15,
      0x483d88,
      0x37bf67,
      0x2bff30,
      0x4ab28d,
      0x3aeb6a,
      0x23a4b5,
      0x6cc5d4,
      0x4c89df,
      0x5b3a0b,
      0x13d263,
      0x1b0ee9,
      0x717288,
      0x5e6f4e,
      0x592e,
      0x3c0030,
      0x300d,
    ],
    CURVE_Pya: [
      0x8cb41,
      0x617728,
      0x5971a3,
      0x106b0c,
      0x1ede4f,
      0x5ceb69,
      0x2a44e8,
      0x4bc1d6,
      0x1b3e68,
      0x2ce793,
      0x3a643b,
      0x31a3db,
      0x573fe,
      0x79293b,
      0x4894d1,
      0x167c9e,
      0x3379,
    ],
    CURVE_Pyb: [
      0x479093,
      0xc86fe,
      0x18eb61,
      0x731124,
      0x43cb0d,
      0x131602,
      0x127def,
      0x78597a,
      0x7a8f7a,
      0x8d67d,
      0x73835,
      0x53d700,
      0x3a7d15,
      0x649dcf,
      0x33631a,
      0x123ee9,
      0x20e5,
    ],
    CURVE_W: [
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_SB: [
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
    ],
    CURVE_WB: [
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_BB: [
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
    ],

    USE_GLV: true,
    USE_GS_G2: true,
    USE_GS_GT: true,
    GT_STRONG: true,

    //debug: false,
  };

  return ROM_CURVE_BLS383;
};

ROM_CURVE_BLS24 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_BLS24 = {
    // BLS24 Curve
    // Base Bits= 23
    CURVE_Cof_I: 0,
    CURVE_A: 0,
    CURVE_B_I: 19,
    CURVE_B: [
      0x13,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Order: [
      0x1,
      0x11ffe0,
      0x464068,
      0x1ffaa8,
      0x71e703,
      0x645bb5,
      0x379fb8,
      0x689d35,
      0x49d0ce,
      0x49091f,
      0x4a7308,
      0x286c0b,
      0x3b44a0,
      0x60b731,
      0x6807c3,
      0x8002,
      0x10010,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Gx: [
      0x63ccd4,
      0x41ebd7,
      0x15919d,
      0x576cfa,
      0x1efe2d,
      0x743f98,
      0xfc23a,
      0x409a3c,
      0x595af8,
      0x6f8df1,
      0x38b611,
      0x65468d,
      0x7e4bfd,
      0x6b0d9d,
      0x7641d,
      0x2eccde,
      0xb7fea,
      0x5bd3c3,
      0x2be521,
      0x71a0be,
      0x1ab2b,
    ],
    CURVE_Gy: [
      0x1e5245,
      0x4b95a4,
      0x5b132e,
      0x462aef,
      0x36d660,
      0x672e8d,
      0x7b4a53,
      0x79e459,
      0x24920f,
      0x4828b0,
      0x58f969,
      0x1d527e,
      0x4e00f6,
      0x457ef3,
      0x66924a,
      0x294ffb,
      0x66a7a4,
      0x70c394,
      0x4f91de,
      0x386362,
      0x47fcb,
    ],

    CURVE_Bnx: [
      0x11ff80,
      0x400,
      0x4,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cof: [
      0x7415ab,
      0x7f7ff3,
      0x5fff07,
      0x2ab555,
      0x5,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cru: [
      0x5794a9,
      0x4e28db,
      0x690ef0,
      0x1c5799,
      0x63a309,
      0x447bb8,
      0x4485d4,
      0x36fdd8,
      0x7bb423,
      0xe24b9,
      0x5e7398,
      0x11ac71,
      0x806e0,
      0x18dd64,
      0x5df5a0,
      0x4307f,
      0x314c20,
      0x4d1c8,
      0x2f16a2,
      0x3c01e,
      0x555c0,
    ],
    CURVE_Pxaa: [
      0x624678,
      0x26a6e9,
      0x22f8a,
      0x212c12,
      0x60c343,
      0x3df8d3,
      0x5d9733,
      0x6bfc87,
      0x2d2888,
      0x758675,
      0x259d1c,
      0x7e922c,
      0x4bab37,
      0x11daab,
      0x6214a4,
      0x758a55,
      0x786671,
      0x72b190,
      0x32581d,
      0x729d1f,
      0x959d,
    ],
    CURVE_Pxab: [
      0x3099b8,
      0x3d75ff,
      0x40e1fe,
      0x9523,
      0x63775a,
      0x78470a,
      0x5746c7,
      0x7cf1b5,
      0x26a730,
      0x14fe14,
      0x76ca97,
      0x61c7c2,
      0x669261,
      0x6a7c2f,
      0x3e5da9,
      0x5f2d68,
      0x2d39d1,
      0x4a3c98,
      0x4cf7f1,
      0x68418b,
      0x3b0de,
    ],
    CURVE_Pxba: [
      0x2d15d3,
      0x1bce23,
      0x5bb687,
      0x46fb70,
      0x185317,
      0x47c134,
      0x2fd0fa,
      0x3597b2,
      0x56de56,
      0x165b19,
      0x1d3f6e,
      0x10e136,
      0x76b1ef,
      0x1913c7,
      0x4011ef,
      0x1f994f,
      0x3fe210,
      0x545186,
      0x41ebca,
      0x7d6a72,
      0x3ec27,
    ],
    CURVE_Pxbb: [
      0x60f480,
      0x650ebd,
      0x2e31ea,
      0x21eb62,
      0x14556e,
      0x1c3973,
      0x48b7e0,
      0xffefd,
      0x50122f,
      0x55ee1f,
      0x263bd7,
      0x2ed92b,
      0x1ba3ad,
      0x39c35e,
      0x2dd201,
      0x17232e,
      0x1da7ce,
      0x4cb0aa,
      0x1e67df,
      0x46de50,
      0xa5b3,
    ],
    CURVE_Pyaa: [
      0x781aa0,
      0x132628,
      0x2ac619,
      0x181db8,
      0x3609da,
      0x3f8897,
      0x4a9851,
      0x189252,
      0x4c42a,
      0x768c5c,
      0x66b9a2,
      0x1c1d70,
      0x4fcadc,
      0x69ed7c,
      0x7d286c,
      0xd685,
      0x198f9,
      0x459da0,
      0x30250d,
      0x1aeb9b,
      0x5057f,
    ],
    CURVE_Pyab: [
      0x2e08fa,
      0x58afdd,
      0x5ab6ef,
      0x5d52fc,
      0x78774,
      0x348594,
      0x32bc26,
      0x23c32,
      0x3bccf7,
      0xb913f,
      0x3e1549,
      0x5b907f,
      0x77b3e6,
      0x22c6ed,
      0x7865fe,
      0x3daefb,
      0x60f558,
      0x702d7a,
      0x3a258d,
      0x24b30f,
      0x2ce2b,
    ],
    CURVE_Pyba: [
      0x70cc41,
      0x4ed4b,
      0x7d5cc,
      0x2a9855,
      0x7f8932,
      0x5f1428,
      0x7361e6,
      0x14406c,
      0x68a9fe,
      0x21dca7,
      0x4dc54e,
      0x10783e,
      0x71f3a4,
      0x3aa336,
      0x6c5305,
      0x1e5adc,
      0x1a39dd,
      0x7c73f0,
      0x18c69a,
      0x2331f7,
      0x18070,
    ],
    CURVE_Pybb: [
      0x5c1cae,
      0x65cca2,
      0x2373c6,
      0x2ad84c,
      0x2d40d3,
      0x714eee,
      0x10ff70,
      0x3ae561,
      0x136b6,
      0x3eba67,
      0x75cbf3,
      0x327450,
      0x161ac1,
      0x5cb9a1,
      0x2c42ee,
      0x48bb8f,
      0x56d046,
      0x725081,
      0x77b22d,
      0x2756cd,
      0x499d1,
    ],
    CURVE_W: [
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
    ],
    CURVE_SB: [
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
    ],
    CURVE_WB: [
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
    ],
    CURVE_BB: [
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
    ],

    USE_GLV: true,
    USE_GS_G2: true,
    USE_GS_GT: true,
    GT_STRONG: true,

    //debug: false,
  };

  return ROM_CURVE_BLS24;
};

ROM_CURVE_BLS48 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_BLS48 = {
    // BLS48 Curve
    // Base Bits= 23
    CURVE_Cof_I: 0,
    CURVE_A: 0,
    CURVE_B_I: 17,
    CURVE_B: [
      0x11,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Order: [
      0x1,
      0x7e0000,
      0x421bff,
      0x714ed3,
      0x455409,
      0x53842,
      0x7ac588,
      0x7e8a68,
      0xad8c1,
      0x184da5,
      0x7fb5e2,
      0x5e936,
      0x5ef479,
      0x12b881,
      0x46fe3f,
      0x32fd85,
      0x2973c4,
      0x3d260d,
      0x318df1,
      0x88d57,
      0x3f73ea,
      0x1887,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Gx: [
      0x571d33,
      0x5a5ecb,
      0x3fca1,
      0x7f196f,
      0x580554,
      0x23dc17,
      0x591dc,
      0x1987f8,
      0x7ca7f6,
      0x345e03,
      0x203d9a,
      0x1734d,
      0x444e07,
      0x5602b2,
      0x5003e,
      0x5961d5,
      0x30d242,
      0x336bc2,
      0x79241,
      0xe0499,
      0x7edd74,
      0x3b712a,
      0x215d65,
      0x544f49,
      0x9,
    ],
    CURVE_Gy: [
      0x6ed83a,
      0x367fd4,
      0x33da69,
      0x254538,
      0x5c4b95,
      0x2b0cef,
      0x7aa39a,
      0x47d9c8,
      0x677b5f,
      0x4f9e3d,
      0x6dc8a6,
      0x71c0c7,
      0x4b44e2,
      0x4aa8f1,
      0x4c3099,
      0x3071e3,
      0x240862,
      0x1b9ccf,
      0x579c4,
      0x4d1997,
      0x3349da,
      0x3f5c56,
      0x5318b1,
      0x56c684,
      0x0,
    ],

    CURVE_Bnx: [
      0x640020,
      0xfb,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cof: [
      0x12abeb,
      0x221efe,
      0x528b,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cru: [
      0x3ba429,
      0x1cfcd9,
      0x1600d9,
      0x49a7ba,
      0x4e30a2,
      0x101275,
      0xf1a0c,
      0x6d146e,
      0x42b839,
      0x118594,
      0x4ef0b4,
      0x55cdb,
      0x67127b,
      0x3d8d31,
      0x319233,
      0x2571c,
      0x1aeeff,
      0x72bc73,
      0x91318,
      0x1911e0,
      0x279f78,
      0x646407,
      0x73df3b,
      0x68bec1,
      0xf,
    ],
    CURVE_Pxaaa: [
      0x23ce4a,
      0x5d1d12,
      0x74aa34,
      0x695c09,
      0x3d7102,
      0x274419,
      0x76284c,
      0x69f0b2,
      0x4637c1,
      0x5fe3fe,
      0x242e62,
      0x3f853e,
      0x4dd2b3,
      0x672bde,
      0x6ed92,
      0x2b9bad,
      0x6c4abf,
      0x393882,
      0x32ee21,
      0x2ef3a1,
      0x59487e,
      0x92f4b,
      0x26870,
      0x32bc6c,
      0xe,
    ],
    CURVE_Pxaab: [
      0xa1be1,
      0x1b8b58,
      0x7dc9c7,
      0x3beb,
      0x28fe3b,
      0x72e58b,
      0x51e10c,
      0x31856a,
      0x389247,
      0x15b9fd,
      0x2847ea,
      0x2e35a0,
      0x9b0e7,
      0x7f92ce,
      0x6960c8,
      0xc5821,
      0x48632d,
      0xc919c,
      0x3c27f4,
      0x2a934d,
      0x348b6e,
      0x2f6b1b,
      0x179d2a,
      0x4a1009,
      0x2,
    ],
    CURVE_Pxaba: [
      0xc5dc4,
      0x6498ee,
      0x4b68e9,
      0x6ed677,
      0x2964ad,
      0x7d8e6d,
      0x4d0966,
      0x550884,
      0x1926ac,
      0x47162d,
      0x633555,
      0x265962,
      0x6402b8,
      0x48f745,
      0x68195f,
      0x198b3a,
      0x117ce2,
      0x5e9efb,
      0x729335,
      0x471f6e,
      0x3689ba,
      0x3bb4f1,
      0x3ddb5c,
      0x297f7c,
      0xb,
    ],
    CURVE_Pxabb: [
      0x64b740,
      0x52cd34,
      0x578358,
      0x464902,
      0x11fd49,
      0x475ba2,
      0x5c150c,
      0x436206,
      0x335e27,
      0x7cfa66,
      0x53ba9f,
      0x39e20f,
      0x41e3c,
      0x30cb43,
      0x5e7d7a,
      0x4869da,
      0x6b405,
      0x57b683,
      0x77306a,
      0x3e774a,
      0x63b1a6,
      0x4be47e,
      0x764b7f,
      0x1c2054,
      0x9,
    ],
    CURVE_Pxbaa: [
      0x71e01f,
      0x18c2e5,
      0x26ec,
      0x1a5853,
      0x4311cd,
      0x430f11,
      0x43e8e4,
      0x20204c,
      0x35ab89,
      0x775c07,
      0x43202c,
      0x442943,
      0x1e3472,
      0xb1bea,
      0x14841d,
      0x56a6a1,
      0x4e27c3,
      0x6ac397,
      0x111e6a,
      0x453f3c,
      0x449d32,
      0x6288f9,
      0x7d0633,
      0x6f0f7b,
      0xd,
    ],
    CURVE_Pxbab: [
      0x37383d,
      0x70470c,
      0x66c28,
      0x7ccc3f,
      0x220253,
      0x27a425,
      0x147b57,
      0x64a9ae,
      0x7a0147,
      0x61ce2b,
      0x7620bf,
      0x1ceb9b,
      0x3f1646,
      0x5546dc,
      0x12aec8,
      0x2a6d46,
      0x38885e,
      0xa7fd0,
      0x3a2974,
      0x7872f1,
      0x4f91fb,
      0x2ade02,
      0x632141,
      0x16d9d3,
      0x8,
    ],
    CURVE_Pxbba: [
      0x11939c,
      0x7b67ae,
      0x6ba5a0,
      0x34d20c,
      0x1be51d,
      0x65ed81,
      0x6d5cb3,
      0x6465e6,
      0x40b384,
      0x146e44,
      0x54f471,
      0x119f79,
      0x11a9b3,
      0x5235b8,
      0x342402,
      0x6b0380,
      0x51a403,
      0x22e30f,
      0x1f23ba,
      0x468cdf,
      0x5a9ccf,
      0x77c486,
      0x613650,
      0x411539,
      0xa,
    ],
    CURVE_Pxbbb: [
      0x6f4899,
      0x2150a,
      0x750cb5,
      0x4952b2,
      0x1c51eb,
      0x179378,
      0x295e64,
      0x5b5457,
      0x47a789,
      0x1403f8,
      0x62578c,
      0x2f5d38,
      0x7fe82c,
      0x6cff62,
      0x32162,
      0x3acbe5,
      0x1e3000,
      0x668f,
      0x426a4b,
      0x4f46ed,
      0x57a328,
      0x62acf0,
      0xf705b,
      0x7baa3c,
      0xd,
    ],
    CURVE_Pyaaa: [
      0x137844,
      0x2f9f68,
      0x4ddb82,
      0x4ffa79,
      0x44ec64,
      0x6d10a3,
      0x1beaf1,
      0x4b2f5c,
      0xb8a71,
      0x20ab1c,
      0x225b80,
      0x663e7c,
      0x673c10,
      0x7e8ea9,
      0x2fc388,
      0x66e9cc,
      0x202f56,
      0x39587c,
      0x343e8c,
      0x52c8bf,
      0x6190b,
      0x11fb0e,
      0x6124d5,
      0x337685,
      0x7,
    ],
    CURVE_Pyaab: [
      0x483190,
      0x6491db,
      0x424978,
      0x23544c,
      0x2eaaf4,
      0x31a65,
      0x48eeb1,
      0x7eeb0e,
      0x91f2f,
      0x2d992c,
      0xf07c,
      0x4ae56f,
      0x688ed2,
      0x62e3a0,
      0x284758,
      0x15cf7,
      0x7e205e,
      0x9fa40,
      0x24ea65,
      0xce87c,
      0x7a1c42,
      0x1c4d1d,
      0x4f76aa,
      0x3ce59c,
      0x2,
    ],
    CURVE_Pyaba: [
      0x185c0d,
      0x3fa083,
      0xfa771,
      0x50c8ee,
      0xd404d,
      0x759d3,
      0x697d52,
      0x6598bc,
      0x685c7c,
      0x612d58,
      0x160d06,
      0x2201f3,
      0x5c797c,
      0x10c374,
      0xe7e1c,
      0x52fa00,
      0x1f60b0,
      0x42b24,
      0x7635e0,
      0xdd262,
      0x140d61,
      0x26a7e6,
      0x595fbc,
      0x22cde4,
      0xd,
    ],
    CURVE_Pyabb: [
      0x1d42f8,
      0x41502b,
      0x5d7dbf,
      0x88b12,
      0x243afd,
      0x3cfe57,
      0x4ec3fa,
      0x2fb013,
      0x7c3cff,
      0x1d3717,
      0x79401a,
      0x33c434,
      0x635f37,
      0x29e4f6,
      0x2ca2db,
      0x7a8ef0,
      0x3fd902,
      0x3309c9,
      0x1f125b,
      0x3ff0c9,
      0x7310,
      0x3137db,
      0x280e0b,
      0x70755,
      0xa,
    ],
    CURVE_Pybaa: [
      0x38039f,
      0x25673e,
      0x184354,
      0x3e78d1,
      0xee895,
      0x1279f,
      0x285016,
      0x445c85,
      0x4bfe85,
      0x7f8597,
      0x2aedd5,
      0x2e62f9,
      0x32710c,
      0x4f5b51,
      0x59016c,
      0x6178c7,
      0x6e268e,
      0x2d39ef,
      0x2c36b6,
      0x717762,
      0x1d1abc,
      0x323714,
      0x7c7bb9,
      0x582324,
      0x2,
    ],
    CURVE_Pybab: [
      0x5f7865,
      0x40de52,
      0x20e9a7,
      0x7439d3,
      0x3f0756,
      0x595baf,
      0x7cfc76,
      0x287b18,
      0x56074e,
      0x186679,
      0x416ec0,
      0x1dc812,
      0x127fbe,
      0x18d9b5,
      0x3c4a9d,
      0x1c2bb4,
      0x135ca4,
      0x7a40ac,
      0x739984,
      0x6f008c,
      0x7180ea,
      0x58af6d,
      0x5b4b02,
      0x9194c,
      0x3,
    ],
    CURVE_Pybba: [
      0x4c1979,
      0x753ecf,
      0x6f0760,
      0x3bb13c,
      0x4aaf9c,
      0x6bfb52,
      0x470858,
      0x41323d,
      0x5401d8,
      0x494404,
      0x5ccf5c,
      0xbcf06,
      0x7e6ecf,
      0x5a9c20,
      0xd2dff,
      0x64ff44,
      0x31645b,
      0x4ee883,
      0x4e22ec,
      0x112445,
      0x486c5c,
      0x5c8211,
      0x67da66,
      0x400692,
      0xc,
    ],
    CURVE_Pybbb: [
      0x49f25b,
      0x12ac5f,
      0x5d33f2,
      0x35d356,
      0x2c4f80,
      0x3a4c9e,
      0x3c5a72,
      0x426c74,
      0x5dac92,
      0x52c146,
      0x61366b,
      0x6cde77,
      0x5a9e8f,
      0x6dff70,
      0x6d20e3,
      0x5a60e6,
      0x33df1a,
      0x2afa7,
      0x390f0,
      0x6320a2,
      0x3f5493,
      0x1cc373,
      0x174990,
      0x7b09b,
      0xa,
    ],
    CURVE_W: [
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
    ],
    CURVE_SB: [
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
    ],
    CURVE_WB: [
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
    ],
    CURVE_BB: [
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
    ],

    USE_GLV: true,
    USE_GS_G2: true,
    USE_GS_GT: true,
    GT_STRONG: true,

    //debug: false,
  };

  return ROM_CURVE_BLS48;
};

ROM_CURVE_BLS381 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_BLS381 = {
    // BLS381 Curve
    // Base Bits= 23

    CURVE_Cof_I: 0,
    CURVE_A: 0,
    CURVE_B_I: 4,
    CURVE_B: [0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Order: [
      0x1,
      0x7ffe00,
      0x7bffff,
      0x7ff2df,
      0x5a402f,
      0xaa77,
      0x26876,
      0x1cec04,
      0x7d4833,
      0x26533a,
      0x4fb69d,
      0x3,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Gx: [
      0x22c6bb,
      0x6015b6,
      0x3feceb,
      0x4bd0d7,
      0x5e83ff,
      0xb0d8a,
      0x45c6eb,
      0x271d1f,
      0x3905a1,
      0x1f2ee9,
      0xda231,
      0x4d607e,
      0x38c4fa,
      0x4d2ac,
      0x65f5e5,
      0x69d398,
      0x17f1,
    ],
    CURVE_Gy: [
      0x45e7e1,
      0x46528d,
      0x1032a8,
      0x144457,
      0x4c744a,
      0x7dba07,
      0x4b012c,
      0x6d8c65,
      0xaf600,
      0x2baba0,
      0x73d782,
      0x6c5727,
      0xed741,
      0x3413c6,
      0x6aa83c,
      0x7a40f1,
      0x8b3,
    ],

    CURVE_Bnx: [
      0x10000,
      0x0,
      0x34804,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cof: [
      0xaaab,
      0x555600,
      0x5a3002,
      0x2aaf0a,
      0x48c005,
      0x72d,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cru: [
      0x7efffe,
      0x7fffff,
      0x8b807,
      0x105000,
      0x7d8136,
      0x511bc2,
      0x79be25,
      0x59d49d,
      0x77eadd,
      0xed41e,
      0x69a718,
      0x36728d,
      0x72fdf7,
      0xbe32c,
      0x0,
      0x0,
      0x0,
    ],

    CURVE_Pxa: [
      0x21bdb8,
      0x2d9182,
      0x3f5201,
      0x402ddf,
      0x40326a,
      0x2ee175,
      0x1eb8f4,
      0x2885b2,
      0x3b02b4,
      0x29f480,
      0x1b91eb,
      0x28828e,
      0x5272dc,
      0x24c100,
      0x23c2a4,
      0x515978,
      0x24a,
    ],
    CURVE_Pxb: [
      0x42b7e,
      0x7a0aba,
      0x5f96b1,
      0x1ca2ea,
      0x4f1121,
      0x92669,
      0x771fd4,
      0x6d30dd,
      0x361ab5,
      0x213241,
      0x65af43,
      0x3a7b2a,
      0x3a0882,
      0xfb59a,
      0x1c67d8,
      0x15b029,
      0x13e0,
    ],
    CURVE_Pya: [
      0x382801,
      0x290c11,
      0x27864d,
      0x5d6514,
      0x2c9cc3,
      0x259247,
      0x545834,
      0x214d34,
      0x53a76d,
      0x55197b,
      0x37f66e,
      0x71a8d5,
      0x5c6da2,
      0x319939,
      0x1f5b84,
      0x6a93b9,
      0xce5,
    ],
    CURVE_Pyb: [
      0x5f79be,
      0xebfe0,
      0x6aaa4,
      0x6760ed,
      0x70d275,
      0x3567e6,
      0x55cba6,
      0x3a4955,
      0x63af26,
      0x7d0b4e,
      0x2cf8a1,
      0x145cce,
      0x2b02bc,
      0x6559a,
      0x29cd33,
      0x625017,
      0x606,
    ],
    CURVE_W: [
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_SB: [
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
    ],
    CURVE_WB: [
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_BB: [
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
    ],

    USE_GLV: true,
    USE_GS_G2: true,
    USE_GS_GT: true,
    GT_STRONG: false,

    //debug: false,
  };

  return ROM_CURVE_BLS381;
};

ROM_CURVE_BLS461 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_BLS461 = {
    // BLS461 Curve
    // Base Bits= 23

    CURVE_Cof_I: 0,
    CURVE_A: 0,
    CURVE_B_I: 9,
    CURVE_B: [
      0x9,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Order: [
      0x1,
      0x0,
      0x700000,
      0x7f7fff,
      0x7feff,
      0x22000,
      0x7f2000,
      0x7e00bf,
      0xe801,
      0x40bfa0,
      0x5ff,
      0x7fe00c,
      0x7fff7f,
      0x1ff,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Gx: [
      0x5ee93d,
      0x4d515,
      0x504534,
      0x773a5b,
      0x2d9c00,
      0x6358fe,
      0x6606d4,
      0x4114e1,
      0x4dc921,
      0x21a6ac,
      0x282599,
      0x7be149,
      0x436166,
      0x45632e,
      0x1a2fa4,
      0x38967b,
      0xc8132,
      0x476e74,
      0x3a66d1,
      0x56873a,
      0x0,
    ],
    CURVE_Gy: [
      0x51d465,
      0x462af5,
      0x51c3dd,
      0x64627f,
      0x517884,
      0x71a42b,
      0x6799a,
      0x2ce854,
      0x245f49,
      0x15cb86,
      0x2e1244,
      0x45fd20,
      0x16eecb,
      0x3f197d,
      0x3322fe,
      0x1793bd,
      0x5f1c3f,
      0x3ed192,
      0x452cc1,
      0x3bde6d,
      0x0,
    ],

    CURVE_Bnx: [
      0x0,
      0x7ffc00,
      0x7fffef,
      0xff,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cof: [
      0x2aaaab,
      0x7ffd55,
      0x5aaa9f,
      0x5580aa,
      0x7d55aa,
      0x2a9fff,
      0x5555,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cru: [
      0x7ffffe,
      0x3ff,
      0x10,
      0x7fff00,
      0x7ffe7f,
      0x61ffed,
      0x311f,
      0x630239,
      0x6db7bc,
      0x622af2,
      0x73d1dd,
      0x43aa19,
      0x3f0e89,
      0xa04c2,
      0x581400,
      0x7f5fff,
      0x1ffff,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Pxa: [
      0x50a37c,
      0x20630d,
      0x31196d,
      0x173aee,
      0x1c2e49,
      0x2d0f15,
      0x7e467,
      0x7ab270,
      0x74ff92,
      0x610db6,
      0x19a00f,
      0x36ac0d,
      0x6d78d4,
      0x78520f,
      0x224be5,
      0x1e1386,
      0x767945,
      0x4a1535,
      0x4e281a,
      0x662a0,
      0x1,
    ],
    CURVE_Pxb: [
      0x41c0ad,
      0x395185,
      0x37a7e1,
      0x6212e5,
      0x16cd66,
      0x4512c1,
      0x4a546,
      0x200d63,
      0x3ebee2,
      0x7aa535,
      0x7d96c5,
      0x504e99,
      0x45af5b,
      0x6e3da9,
      0x4b9350,
      0x123533,
      0x2279d2,
      0x1d46f9,
      0x53f96b,
      0x4ae0fd,
      0x0,
    ],
    CURVE_Pya: [
      0x2fb006,
      0x218360,
      0xcdf33,
      0x525095,
      0x53d194,
      0x125912,
      0x5833f3,
      0x6345a4,
      0xf39f,
      0x1e7536,
      0x7b46e8,
      0x3edde2,
      0x4dfd8a,
      0x5ef53,
      0x3489f3,
      0x7a739f,
      0x6070f4,
      0x74fcce,
      0x1239fa,
      0x113564,
      0x0,
    ],
    CURVE_Pyb: [
      0x71457c,
      0xd5bfb,
      0x2a294,
      0x6e0261,
      0x4d6a31,
      0x6dc7f6,
      0x26a3c4,
      0x2b3475,
      0x64492f,
      0x2e7877,
      0x19e84a,
      0x25f55d,
      0x220be7,
      0x5c70ad,
      0x7c1310,
      0x228ab,
      0x2ab1d0,
      0x6805d4,
      0x6d3eae,
      0x71c080,
      0x0,
    ],
    CURVE_W: [
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
    ],
    CURVE_SB: [
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
    ],
    CURVE_WB: [
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
    ],
    CURVE_BB: [
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
    ],

    USE_GLV: true,
    USE_GS_G2: true,
    USE_GS_GT: true,
    GT_STRONG: false,

    //debug: false,
  };

  return ROM_CURVE_BLS461;
};

ROM_CURVE_FP256BN = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_FP256BN = {
    // FP256BN Curve
    // Base Bits= 24

    CURVE_Cof_I: 1,
    CURVE_A: 0,
    CURVE_B_I: 3,
    CURVE_B: [0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Order: [
      0xb500d,
      0x536cd1,
      0x1af62d,
      0x129992,
      0xdc65fb,
      0xa49e0c,
      0x5eee71,
      0x46e5f2,
      0xfcf0cd,
      0xffffff,
      0xffff,
    ],
    CURVE_Gx: [0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Gy: [0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],

    CURVE_Bnx: [0xb0a801, 0xf5c030, 0x6882, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Cof: [0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Cru: [
      0xa1b807,
      0xa24a3,
      0x1edb1c,
      0xf1932d,
      0xcdd79d,
      0x18659b,
      0x409210,
      0x3988e1,
      0x1,
      0x0,
      0x0,
    ],
    CURVE_Pxa: [
      0xc09efb,
      0x16b689,
      0x3cd226,
      0x12bf84,
      0x1c539a,
      0x913ace,
      0x577c28,
      0x28560f,
      0xc96c20,
      0x3350b4,
      0xfe0c,
    ],
    CURVE_Pxb: [
      0x7e6a2b,
      0xed34a3,
      0x89d269,
      0x87d035,
      0xdd78e2,
      0x13b924,
      0xc637d8,
      0xdb5ae1,
      0x8ac054,
      0x605773,
      0x4ea6,
    ],
    CURVE_Pya: [
      0xdc27ff,
      0xb481be,
      0x48e909,
      0x8d6158,
      0xcb2475,
      0x3e51ef,
      0x75124e,
      0x76770d,
      0x42a3b3,
      0x46e7c5,
      0x7020,
    ],
    CURVE_Pyb: [
      0xad049b,
      0x81114a,
      0xb3e012,
      0x821a98,
      0x4cbe80,
      0xb29f8b,
      0x49297e,
      0x42eea6,
      0x88c290,
      0xe3bcd3,
      0x554,
    ],

    CURVE_W: [
      [0x54003, 0x36e1b, 0x663af0, 0xfffe78, 0xffffff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x615001, 0xeb8061, 0xd105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_SB: [
      [
        [0x669004, 0xeeee7c, 0x670bf5, 0xfffe78, 0xffffff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x615001, 0xeb8061, 0xd105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x615001, 0xeb8061, 0xd105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [
          0x6100a,
          0x4ffeb6,
          0xb4bb3d,
          0x129b19,
          0xdc65fb,
          0xa49d0c,
          0x5eee71,
          0x46e5f2,
          0xfcf0cd,
          0xffffff,
          0xffff,
        ],
      ],
    ],
    CURVE_WB: [
      [0x30a800, 0x678f0d, 0xcc1020, 0x5554d2, 0x555555, 0x55, 0x0, 0x0, 0x0, 0x0, 0x0],
      [
        0x7dc805,
        0x764c0d,
        0xad1ad6,
        0xa10bc3,
        0xde8fbe,
        0x104467,
        0x806160,
        0xd105eb,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x173803,
        0xb6061f,
        0xd6c1ac,
        0x5085e1,
        0xef47df,
        0x82233,
        0xc030b0,
        0x6882f5,
        0x0,
        0x0,
        0x0,
      ],
      [0x91f801, 0x530f6e, 0xcce126, 0x5554d2, 0x555555, 0x55, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_BB: [
      [
        [
          0x5aa80d,
          0x5daca0,
          0x1a8daa,
          0x129992,
          0xdc65fb,
          0xa49e0c,
          0x5eee71,
          0x46e5f2,
          0xfcf0cd,
          0xffffff,
          0xffff,
        ],
        [
          0x5aa80c,
          0x5daca0,
          0x1a8daa,
          0x129992,
          0xdc65fb,
          0xa49e0c,
          0x5eee71,
          0x46e5f2,
          0xfcf0cd,
          0xffffff,
          0xffff,
        ],
        [
          0x5aa80c,
          0x5daca0,
          0x1a8daa,
          0x129992,
          0xdc65fb,
          0xa49e0c,
          0x5eee71,
          0x46e5f2,
          0xfcf0cd,
          0xffffff,
          0xffff,
        ],
        [0x615002, 0xeb8061, 0xd105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x615001, 0xeb8061, 0xd105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [
          0x5aa80c,
          0x5daca0,
          0x1a8daa,
          0x129992,
          0xdc65fb,
          0xa49e0c,
          0x5eee71,
          0x46e5f2,
          0xfcf0cd,
          0xffffff,
          0xffff,
        ],
        [
          0x5aa80d,
          0x5daca0,
          0x1a8daa,
          0x129992,
          0xdc65fb,
          0xa49e0c,
          0x5eee71,
          0x46e5f2,
          0xfcf0cd,
          0xffffff,
          0xffff,
        ],
        [
          0x5aa80c,
          0x5daca0,
          0x1a8daa,
          0x129992,
          0xdc65fb,
          0xa49e0c,
          0x5eee71,
          0x46e5f2,
          0xfcf0cd,
          0xffffff,
          0xffff,
        ],
      ],
      [
        [0x615002, 0xeb8061, 0xd105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x615001, 0xeb8061, 0xd105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x615001, 0xeb8061, 0xd105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x615001, 0xeb8061, 0xd105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0xb0a802, 0xf5c030, 0x6882, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0xc2a002, 0xd700c2, 0x1a20b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [
          0xaa000a,
          0x67ec6f,
          0x1a2527,
          0x129992,
          0xdc65fb,
          0xa49e0c,
          0x5eee71,
          0x46e5f2,
          0xfcf0cd,
          0xffffff,
          0xffff,
        ],
        [0xb0a802, 0xf5c030, 0x6882, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
    ],

    USE_GLV: true,
    USE_GS_G2: true,
    USE_GS_GT: true,
    GT_STRONG: false,

    //debug: false,
  };

  return ROM_CURVE_FP256BN;
};

ROM_CURVE_FP512BN = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_FP512BN = {
    // FP512BN Curve

    // Base Bits= 23

    CURVE_Cof_I: 1,
    CURVE_A: 0,
    CURVE_B_I: 3,
    CURVE_B: [
      0x3,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Order: [
      0x1a09ed,
      0x14bea3,
      0x501a99,
      0x27cd15,
      0x313e0,
      0x346942,
      0x2ac99e,
      0x4632ef,
      0x18b8e4,
      0x3d597d,
      0x451b3c,
      0x77a22,
      0x3c111b,
      0x78177c,
      0x32d4c1,
      0x5d0ec,
      0x7f01c6,
      0x7ff3d8,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x3f,
    ],
    CURVE_Gx: [
      0x1,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Gy: [
      0x2,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],

    CURVE_Bnx: [
      0x1bd80f,
      0xd76bc,
      0x4042cc,
      0x587bf,
      0x2f5c03,
      0xd10,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cof: [
      0x1,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Cru: [
      0x79298a,
      0x2c4138,
      0x52c1c,
      0x5c58be,
      0x6e6799,
      0x1255d9,
      0x2f9498,
      0x43c4b3,
      0x507acd,
      0x11384e,
      0x1d2c80,
      0x8fd18,
      0x78ef76,
      0x71d459,
      0x2e1acd,
      0x1530a3,
      0x7dc83d,
      0x7ff3d8,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x3f,
    ],
    CURVE_Pxa: [
      0x3646b5,
      0x52dc1b,
      0x7a3c1e,
      0x48397f,
      0xf8731,
      0x71e443,
      0x6f2ef1,
      0x2bdf10,
      0x4dc6dc,
      0x70c6a2,
      0x40914d,
      0x3c6685,
      0x5a57cc,
      0x3736af,
      0x4d63c3,
      0x5de94d,
      0x6a1e4b,
      0x25e79,
      0x6e9d,
      0x244ac4,
      0x1e1386,
      0x62ca67,
      0xe,
    ],
    CURVE_Pxb: [
      0xae0e9,
      0x17dfb5,
      0x6cf6d7,
      0x6c4488,
      0x4a411c,
      0x5b9c81,
      0x4e0f56,
      0x286b70,
      0x6e0d5e,
      0x650aa4,
      0x607889,
      0x5ca6cb,
      0x302566,
      0x48ed51,
      0x1b1bbc,
      0x532b6e,
      0x34825e,
      0x157d1,
      0x6d311a,
      0x3f3644,
      0x3f8506,
      0x38279,
      0x12,
    ],
    CURVE_Pya: [
      0x5e67a1,
      0x6255b,
      0x178920,
      0xaf7dc,
      0x217ad6,
      0x778b9b,
      0xa022d,
      0x11892a,
      0x3e8edd,
      0x7bd82a,
      0x5b3462,
      0x34cea5,
      0x65c158,
      0x1ba07d,
      0x5982bf,
      0x42d8ef,
      0x4f2770,
      0x19746e,
      0x3bd6ac,
      0x3dc149,
      0x4c827c,
      0x603d90,
      0x1b,
    ],
    CURVE_Pyb: [
      0x4f8e8b,
      0x630d90,
      0x5a162d,
      0x25fbb0,
      0x5c222,
      0x11bfe,
      0x7b89e7,
      0x18856b,
      0x714a4,
      0x7c5ca,
      0xa25ff,
      0xca0ed,
      0x3d0496,
      0x61936c,
      0x46219e,
      0xa1c60,
      0x591f02,
      0x62beeb,
      0xd9030,
      0x3c18d6,
      0x48b04e,
      0x34779d,
      0x14,
    ],
    CURVE_W: [
      [
        0x34583,
        0x712e93,
        0x4fc443,
        0x68b50b,
        0x5fb911,
        0x47fd2c,
        0x7fff3d,
        0x7fffff,
        0x7fffff,
        0x7fffff,
        0x7fffff,
        0x7,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x37b01f,
        0x1aed78,
        0x8598,
        0xb0f7f,
        0x5eb806,
        0x1a20,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
    ],
    CURVE_SB: [
      [
        [
          0x4b9564,
          0x56411a,
          0x4f3eab,
          0x5da58c,
          0x1010b,
          0x47e30c,
          0x7fff3d,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x6259ce,
          0x79d12a,
          0x4f9500,
          0x1cbd96,
          0x245bda,
          0x344f21,
          0x2ac99e,
          0x4632ef,
          0x18b8e4,
          0x3d597d,
          0x451b3c,
          0x77a22,
          0x3c111b,
          0x78177c,
          0x32d4c1,
          0x5d0ec,
          0x7f01c6,
          0x7ff3d8,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x3f,
        ],
      ],
      [
        [
          0x37b01f,
          0x1aed78,
          0x8598,
          0xb0f7f,
          0x5eb806,
          0x1a20,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x34583,
          0x712e93,
          0x4fc443,
          0x68b50b,
          0x5fb911,
          0x47fd2c,
          0x7fff3d,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
    ],
    CURVE_WB: [
      [
        0x5a29f0,
        0x66d56a,
        0x305b6a,
        0x2c1e98,
        0x442c60,
        0x42bf7f,
        0x555514,
        0x2aaaaa,
        0x555555,
        0x2aaaaa,
        0x555555,
        0x2,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x355d4b,
        0x25744,
        0x45fbac,
        0x6bfc27,
        0x20fc1f,
        0x6bcb9e,
        0x2778ae,
        0x2c497d,
        0x5ad40f,
        0x72c0c9,
        0x4549d2,
        0x29a8b1,
        0x576bc3,
        0x42cc1,
        0x587bf8,
        0x75c030,
        0xd105,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x289aad,
        0x7e700,
        0x431f3c,
        0x38c1f3,
        0x282c11,
        0x35ec57,
        0x53bc57,
        0x5624be,
        0x6d6a07,
        0x396064,
        0x62a4e9,
        0x54d458,
        0x6bb5e1,
        0x21660,
        0x2c3dfc,
        0x7ae018,
        0x6882,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
      [
        0x2279d1,
        0x4be7f2,
        0x2fd5d2,
        0x210f19,
        0x65745a,
        0x42a55e,
        0x555514,
        0x2aaaaa,
        0x555555,
        0x2aaaaa,
        0x555555,
        0x2,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
        0x0,
      ],
    ],
    CURVE_BB: [
      [
        [
          0x1bd810,
          0xd76bc,
          0x4042cc,
          0x587bf,
          0x2f5c03,
          0xd10,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x1bd80f,
          0xd76bc,
          0x4042cc,
          0x587bf,
          0x2f5c03,
          0xd10,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x1bd80f,
          0xd76bc,
          0x4042cc,
          0x587bf,
          0x2f5c03,
          0xd10,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x6259cf,
          0x79d12a,
          0x4f9500,
          0x1cbd96,
          0x245bda,
          0x344f21,
          0x2ac99e,
          0x4632ef,
          0x18b8e4,
          0x3d597d,
          0x451b3c,
          0x77a22,
          0x3c111b,
          0x78177c,
          0x32d4c1,
          0x5d0ec,
          0x7f01c6,
          0x7ff3d8,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x3f,
        ],
      ],
      [
        [
          0x37b01f,
          0x1aed78,
          0x8598,
          0xb0f7f,
          0x5eb806,
          0x1a20,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x7e31de,
          0x747e6,
          0xfd7cd,
          0x224556,
          0x53b7dd,
          0x345c31,
          0x2ac99e,
          0x4632ef,
          0x18b8e4,
          0x3d597d,
          0x451b3c,
          0x77a22,
          0x3c111b,
          0x78177c,
          0x32d4c1,
          0x5d0ec,
          0x7f01c6,
          0x7ff3d8,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x3f,
        ],
        [
          0x7e31dd,
          0x747e6,
          0xfd7cd,
          0x224556,
          0x53b7dd,
          0x345c31,
          0x2ac99e,
          0x4632ef,
          0x18b8e4,
          0x3d597d,
          0x451b3c,
          0x77a22,
          0x3c111b,
          0x78177c,
          0x32d4c1,
          0x5d0ec,
          0x7f01c6,
          0x7ff3d8,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x3f,
        ],
        [
          0x7e31de,
          0x747e6,
          0xfd7cd,
          0x224556,
          0x53b7dd,
          0x345c31,
          0x2ac99e,
          0x4632ef,
          0x18b8e4,
          0x3d597d,
          0x451b3c,
          0x77a22,
          0x3c111b,
          0x78177c,
          0x32d4c1,
          0x5d0ec,
          0x7f01c6,
          0x7ff3d8,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x3f,
        ],
      ],
      [
        [
          0x37b01e,
          0x1aed78,
          0x8598,
          0xb0f7f,
          0x5eb806,
          0x1a20,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x37b01f,
          0x1aed78,
          0x8598,
          0xb0f7f,
          0x5eb806,
          0x1a20,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x37b01f,
          0x1aed78,
          0x8598,
          0xb0f7f,
          0x5eb806,
          0x1a20,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x37b01f,
          0x1aed78,
          0x8598,
          0xb0f7f,
          0x5eb806,
          0x1a20,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
      ],
      [
        [
          0x7e31df,
          0x0747e6,
          0x0fd7cd,
          0x224556,
          0x53b7dd,
          0x345c31,
          0x2ac99e,
          0x4632ef,
          0x18b8e4,
          0x3d597d,
          0x451b3c,
          0x77a22,
          0x3c111b,
          0x78177c,
          0x32d4c1,
          0x5d0ec,
          0x7f01c6,
          0x7ff3d8,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x3f,
        ],
        [
          0x2aa9af,
          0x5ee3b2,
          0x4f0f68,
          0x11ae17,
          0x45a3d4,
          0x343500,
          0x2ac99e,
          0x4632ef,
          0x18b8e4,
          0x3d597d,
          0x451b3c,
          0x77a22,
          0x3c111b,
          0x78177c,
          0x32d4c1,
          0x5d0ec,
          0x7f01c6,
          0x7ff3d8,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x3f,
        ],
        [
          0x37b01d,
          0x1aed78,
          0x008598,
          0x0b0f7f,
          0x5eb806,
          0x001a20,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
          0x0,
        ],
        [
          0x7e31df,
          0x0747e6,
          0x0fd7cd,
          0x224556,
          0x53b7dd,
          0x345c31,
          0x2ac99e,
          0x4632ef,
          0x18b8e4,
          0x3d597d,
          0x451b3c,
          0x77a22,
          0x3c111b,
          0x78177c,
          0x32d4c1,
          0x5d0ec,
          0x7f01c6,
          0x7ff3d8,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x7fffff,
          0x3f,
        ],
      ],
    ],

    USE_GLV: true,
    USE_GS_G2: true,
    USE_GS_GT: true,
    GT_STRONG: false,

    //debug: false,
  };

  return ROM_CURVE_FP512BN;
};

ROM_CURVE_BN254 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_BN254 = {
    // BN254 Curve

    // Base Bits= 24

    CURVE_Cof_I: 1,
    CURVE_A: 0,
    CURVE_B_I: 2,
    CURVE_B: [0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Order: [
      0xd,
      0x0,
      0x10a100,
      0x0,
      0x9f8000,
      0x7ff,
      0x800000,
      0xba344d,
      0x1,
      0x648240,
      0x2523,
    ],
    CURVE_Gx: [
      0x12,
      0x0,
      0x13a700,
      0x0,
      0x210000,
      0x861,
      0x800000,
      0xba344d,
      0x1,
      0x648240,
      0x2523,
    ],
    CURVE_Gy: [0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],

    CURVE_Bnx: [0x1, 0x0, 0x4080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Cof: [0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Cru: [0x7, 0x0, 0x6cd80, 0x0, 0x90000, 0x249, 0x400000, 0x49b362, 0x0, 0x0, 0x0],
    CURVE_Pxa: [
      0x3fb2b,
      0x4224c8,
      0xd91ee,
      0x4898bf,
      0x648bbb,
      0xedb6a4,
      0x7e8c61,
      0xeb8d8c,
      0x9eb62f,
      0x10bb51,
      0x61a,
    ],
    CURVE_Pxb: [
      0xd54cf3,
      0x34c1e7,
      0xb70d8c,
      0xae3784,
      0x4d746b,
      0xaa5b1f,
      0x8c5982,
      0x310aa7,
      0x737833,
      0xaaf9ba,
      0x516,
    ],
    CURVE_Pya: [
      0xcd2b9a,
      0xe07891,
      0xbd19f0,
      0xbdbe09,
      0xbd0ae6,
      0x822329,
      0x96698c,
      0x9a90e0,
      0xaf9343,
      0x97a06b,
      0x218,
    ],
    CURVE_Pyb: [
      0x3ace9b,
      0x1aec6b,
      0x578a2d,
      0xd739c9,
      0x9006ff,
      0x8d37b0,
      0x56f5f3,
      0x8f6d44,
      0x8b1526,
      0x2b0e7c,
      0xebb,
    ],
    CURVE_W: [
      [0x3, 0x0, 0x20400, 0x0, 0x818000, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x1, 0x0, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_SB: [
      [
        [0x4, 0x0, 0x28500, 0x0, 0x818000, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x1, 0x0, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x1, 0x0, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0xa, 0x0, 0xe9d00, 0x0, 0x1e0000, 0x79e, 0x800000, 0xba344d, 0x1, 0x648240, 0x2523],
      ],
    ],
    CURVE_WB: [
      [0x0, 0x0, 0x4080, 0x0, 0x808000, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x5, 0x0, 0x54a80, 0x0, 0x70000, 0x1c7, 0x800000, 0x312241, 0x0, 0x0, 0x0],
      [0x3, 0x0, 0x2c580, 0x0, 0x838000, 0xe3, 0xc00000, 0x189120, 0x0, 0x0, 0x0],
      [0x1, 0x0, 0xc180, 0x0, 0x808000, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_BB: [
      [
        [0xd, 0x0, 0x106080, 0x0, 0x9f8000, 0x7ff, 0x800000, 0xba344d, 0x1, 0x648240, 0x2523],
        [0xc, 0x0, 0x106080, 0x0, 0x9f8000, 0x7ff, 0x800000, 0xba344d, 0x1, 0x648240, 0x2523],
        [0xc, 0x0, 0x106080, 0x0, 0x9f8000, 0x7ff, 0x800000, 0xba344d, 0x1, 0x648240, 0x2523],
        [0x2, 0x0, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x1, 0x0, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0xc, 0x0, 0x106080, 0x0, 0x9f8000, 0x7ff, 0x800000, 0xba344d, 0x1, 0x648240, 0x2523],
        [0xd, 0x0, 0x106080, 0x0, 0x9f8000, 0x7ff, 0x800000, 0xba344d, 0x1, 0x648240, 0x2523],
        [0xc, 0x0, 0x106080, 0x0, 0x9f8000, 0x7ff, 0x800000, 0xba344d, 0x1, 0x648240, 0x2523],
      ],
      [
        [0x2, 0x0, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x1, 0x0, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x1, 0x0, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x1, 0x0, 0x8100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x2, 0x0, 0x4080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x2, 0x0, 0x10200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0xa, 0x0, 0x102000, 0x0, 0x9f8000, 0x7ff, 0x800000, 0xba344d, 0x1, 0x648240, 0x2523],
        [0x2, 0x0, 0x4080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
    ],

    USE_GLV: true,
    USE_GS_G2: true,
    USE_GS_GT: true,
    GT_STRONG: false,

    //debug: false,
  };

  return ROM_CURVE_BN254;
};

ROM_CURVE_BN254CX = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_BN254CX = {
    // BN254CX Curve
    // Base Bits= 24

    CURVE_Cof_I: 1,
    CURVE_A: 0,
    CURVE_B_I: 2,
    CURVE_B: [0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Order: [
      0xeb1f6d,
      0xc0a636,
      0xcebe11,
      0xcc906,
      0x3fd6ee,
      0x66d2c4,
      0x647a63,
      0xb0bddf,
      0x702a0d,
      0x8,
      0x2400,
    ],
    CURVE_Gx: [
      0x1b55b2,
      0x23ef5c,
      0xe1be66,
      0x18093e,
      0x3fd6ee,
      0x66d324,
      0x647a63,
      0xb0bddf,
      0x702a0d,
      0x8,
      0x2400,
    ],
    CURVE_Gy: [0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],

    CURVE_Bnx: [0xc012b1, 0x3, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Cof: [0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Cru: [
      0x235c97,
      0x931794,
      0x5631e0,
      0x71ef87,
      0xbddf64,
      0x3f1440,
      0xca8,
      0x480000,
      0x0,
      0x0,
      0x0,
    ],

    CURVE_Pxa: [
      0xd2ec74,
      0x1ceee4,
      0x26c085,
      0xa03e27,
      0x7c85bf,
      0x4bbb90,
      0xf5c3,
      0x358b25,
      0x53b256,
      0x2d2c70,
      0x1968,
    ],
    CURVE_Pxb: [
      0x29cfe1,
      0x8e8b2e,
      0xf47a5,
      0xc209c3,
      0x1b97b0,
      0x9743f8,
      0x37a8e9,
      0xa011c9,
      0x19f64a,
      0xb9ec3e,
      0x1466,
    ],
    CURVE_Pya: [
      0xbe09f,
      0xfcebcf,
      0xb30cfb,
      0x847ec1,
      0x61b33d,
      0xe20963,
      0x157dae,
      0xd81e22,
      0x332b8d,
      0xedd972,
      0xa79,
    ],
    CURVE_Pyb: [
      0x98ee9d,
      0x4b2288,
      0xebed90,
      0x69d2ed,
      0x864ea5,
      0x3461c2,
      0x512d8d,
      0x35c6e4,
      0xc4c090,
      0xc39ec,
      0x616,
    ],

    CURVE_W: [
      [0x2feb83, 0x634916, 0x120054, 0xb4038, 0x0, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x802561, 0x7, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_SB: [
      [
        [0xb010e4, 0x63491d, 0x128054, 0xb4038, 0x0, 0x60, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x802561, 0x7, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x802561, 0x7, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [
          0xbb33ea,
          0x5d5d20,
          0xbcbdbd,
          0x188ce,
          0x3fd6ee,
          0x66d264,
          0x647a63,
          0xb0bddf,
          0x702a0d,
          0x8,
          0x2400,
        ],
      ],
    ],
    CURVE_WB: [
      [0x7a84b0, 0x211856, 0xb0401c, 0x3c012, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0],
      [0x220475, 0xf995be, 0x9a36cd, 0xa8ca7f, 0x7e94ed, 0x2a0dc0, 0x870, 0x300000, 0x0, 0x0, 0x0],
      [0xf10b93, 0xfccae0, 0xcd3b66, 0xd4653f, 0x3f4a76, 0x1506e0, 0x438, 0x180000, 0x0, 0x0, 0x0],
      [0xfaaa11, 0x21185d, 0xb0c01c, 0x3c012, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0],
    ],
    CURVE_BB: [
      [
        [
          0x2b0cbd,
          0xc0a633,
          0xce7e11,
          0xcc906,
          0x3fd6ee,
          0x66d2c4,
          0x647a63,
          0xb0bddf,
          0x702a0d,
          0x8,
          0x2400,
        ],
        [
          0x2b0cbc,
          0xc0a633,
          0xce7e11,
          0xcc906,
          0x3fd6ee,
          0x66d2c4,
          0x647a63,
          0xb0bddf,
          0x702a0d,
          0x8,
          0x2400,
        ],
        [
          0x2b0cbc,
          0xc0a633,
          0xce7e11,
          0xcc906,
          0x3fd6ee,
          0x66d2c4,
          0x647a63,
          0xb0bddf,
          0x702a0d,
          0x8,
          0x2400,
        ],
        [0x802562, 0x7, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0x802561, 0x7, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [
          0x2b0cbc,
          0xc0a633,
          0xce7e11,
          0xcc906,
          0x3fd6ee,
          0x66d2c4,
          0x647a63,
          0xb0bddf,
          0x702a0d,
          0x8,
          0x2400,
        ],
        [
          0x2b0cbd,
          0xc0a633,
          0xce7e11,
          0xcc906,
          0x3fd6ee,
          0x66d2c4,
          0x647a63,
          0xb0bddf,
          0x702a0d,
          0x8,
          0x2400,
        ],
        [
          0x2b0cbc,
          0xc0a633,
          0xce7e11,
          0xcc906,
          0x3fd6ee,
          0x66d2c4,
          0x647a63,
          0xb0bddf,
          0x702a0d,
          0x8,
          0x2400,
        ],
      ],
      [
        [0x802562, 0x7, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x802561, 0x7, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x802561, 0x7, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x802561, 0x7, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
      [
        [0xc012b2, 0x3, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [0x4ac2, 0xf, 0x10000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
        [
          0x6afa0a,
          0xc0a62f,
          0xce3e11,
          0xcc906,
          0x3fd6ee,
          0x66d2c4,
          0x647a63,
          0xb0bddf,
          0x702a0d,
          0x8,
          0x2400,
        ],
        [0xc012b2, 0x3, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
      ],
    ],

    USE_GLV: true,
    USE_GS_G2: true,
    USE_GS_GT: true,
    GT_STRONG: false,

    //debug: false,
  };

  return ROM_CURVE_BN254CX;
};

ROM_CURVE_BRAINPOOL = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  /* Note that the original curve has been transformed to an isomorphic curve with A=-3 */

  var ROM_CURVE_BRAINPOOL = {
    // Brainpool curve
    // Base Bits= 24

    CURVE_Cof_I: 1,
    CURVE_A: -3,
    CURVE_B_I: 0,
    CURVE_B: [
      0xe92b04,
      0x8101fe,
      0x256ae5,
      0xaf2f49,
      0x93ebc4,
      0x76b7bf,
      0x733d0b,
      0xfe66a7,
      0xd84ea4,
      0x61c430,
      0x662c,
    ],
    CURVE_Order: [
      0x4856a7,
      0xe8297,
      0xf7901e,
      0xb561a6,
      0x397aa3,
      0x8d718c,
      0x909d83,
      0x3e660a,
      0xeea9bc,
      0x57dba1,
      0xa9fb,
    ],
    CURVE_Gx: [
      0x1305f4,
      0x91562e,
      0x2b79a1,
      0x7aafbc,
      0xa142c4,
      0x6149af,
      0xb23a65,
      0x732213,
      0xcfe7b7,
      0xeb3cc1,
      0xa3e8,
    ],
    CURVE_Gy: [
      0x25c9be,
      0xe8f35b,
      0x1dab,
      0x39d027,
      0xbcb6de,
      0x417e69,
      0xe14644,
      0x7f7b22,
      0x39c56d,
      0x6c8234,
      0x2d99,
    ],
  };
  return ROM_CURVE_BRAINPOOL;
};

ROM_CURVE_C25519 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_C25519 = {
    // C25519 Curve

    CURVE_Cof_I: 8,
    CURVE_A: 486662,
    CURVE_B_I: 0,
    CURVE_B: [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Order: [
      0xf5d3ed,
      0x631a5c,
      0xd65812,
      0xa2f79c,
      0xdef9de,
      0x14,
      0x0,
      0x0,
      0x0,
      0x0,
      0x1000,
    ],
    CURVE_Gx: [0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Gy: [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
  };
  return ROM_CURVE_C25519;
};

ROM_CURVE_C41417 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_C41417 = {
    // C41417 curve
    CURVE_Cof_I: 8,
    CURVE_A: 1,
    CURVE_B_I: 3617,
    CURVE_B: [
      0xe21,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Order: [
      0x6af79,
      0x69784,
      0x1b0e7,
      0x18f3c6,
      0x338ad,
      0xdbc70,
      0x6022b,
      0x533dc,
      0x3cc924,
      0x3fffac,
      0x3fffff,
      0x3fffff,
      0x3fffff,
      0x3fffff,
      0x3fffff,
      0x3fffff,
      0x3fffff,
      0x3fffff,
      0x7fff,
    ],
    CURVE_Gx: [
      0xbc595,
      0x204bcf,
      0xc4fd3,
      0x14df19,
      0x33faa8,
      0x4c069,
      0x16ba11,
      0x2ad35b,
      0x1498a4,
      0x15ffcd,
      0x3ec7f,
      0x27d130,
      0xd4636,
      0x9b97f,
      0x631c3,
      0x8630,
      0x144330,
      0x241450,
      0x1a334,
    ],
    CURVE_Gy: [
      0x22,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
  };

  return ROM_CURVE_C41417;
};

ROM_CURVE_ED25519 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_ED25519 = {
    // ED25519 Curve

    CURVE_Cof_I: 8,
    CURVE_A: -1,
    CURVE_B_I: 0,
    CURVE_B: [
      0x5978a3,
      0x4dca13,
      0xab75eb,
      0x4141d8,
      0x700a4d,
      0xe89800,
      0x797779,
      0x8cc740,
      0x6ffe73,
      0x6cee2b,
      0x5203,
    ],
    CURVE_Order: [
      0xf5d3ed,
      0x631a5c,
      0xd65812,
      0xa2f79c,
      0xdef9de,
      0x14,
      0x0,
      0x0,
      0x0,
      0x0,
      0x1000,
    ],
    CURVE_Gx: [
      0x25d51a,
      0x2d608f,
      0xb2c956,
      0x9525a7,
      0x2cc760,
      0xdc5c69,
      0x31fdd6,
      0xc0a4e2,
      0x6e53fe,
      0x36d3cd,
      0x2169,
    ],
    CURVE_Gy: [
      0x666658,
      0x666666,
      0x666666,
      0x666666,
      0x666666,
      0x666666,
      0x666666,
      0x666666,
      0x666666,
      0x666666,
      0x6666,
    ],
  };
  return ROM_CURVE_ED25519;
};

ROM_CURVE_GOLDILOCKS = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_GOLDILOCKS = {
    // GOLDILOCKS curve
    CURVE_Cof_I: 4,
    CURVE_A: 1,
    CURVE_B_I: -39081,
    CURVE_B: [
      0x7f6756,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7dffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7ff,
    ],
    CURVE_Order: [
      0x5844f3,
      0x52556,
      0x548de3,
      0x6e2c7a,
      0x4c2728,
      0x52042d,
      0x6bb58d,
      0x276da4,
      0x23e9c4,
      0x7ef994,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x1ff,
    ],
    CURVE_Gx: [
      0x555555,
      0x2aaaaa,
      0x555555,
      0x2aaaaa,
      0x555555,
      0x2aaaaa,
      0x555555,
      0x2aaaaa,
      0x555555,
      0x52aaaa,
      0x2aaaaa,
      0x555555,
      0x2aaaaa,
      0x555555,
      0x2aaaaa,
      0x555555,
      0x2aaaaa,
      0x555555,
      0x2aaaaa,
      0x555,
    ],
    CURVE_Gy: [
      0x1386ed,
      0x779bd5,
      0x2f6bab,
      0xe6d03,
      0x4b2bed,
      0x131777,
      0x4e8a8c,
      0x32b2c1,
      0x44b80d,
      0x6515b1,
      0x5f8db5,
      0x426ebd,
      0x7a0358,
      0x6dda,
      0x21b0ac,
      0x6b1028,
      0xdb359,
      0x15ae09,
      0x17a58d,
      0x570,
    ],
  };
  return ROM_CURVE_GOLDILOCKS;
};

ROM_CURVE_HIFIVE = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_HIFIVE = {
    // HIFIVE curve

    CURVE_Cof_I: 8,
    CURVE_A: 1,
    CURVE_B_I: 11111,
    CURVE_B: [0x2b67, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Order: [
      0x1fa805,
      0x2b2e7d,
      0x29ecbe,
      0x3fc9dd,
      0xbd6b8,
      0x530a18,
      0x45057e,
      0x3,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x800,
    ],
    CURVE_Gx: [0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Gy: [
      0x7e8632,
      0xd0a0b,
      0x6c4afb,
      0x501b2e,
      0x55650c,
      0x36db6b,
      0x1fbd0d,
      0x61c08e,
      0x314b46,
      0x70a7a3,
      0x587401,
      0xc70e0,
      0x56502e,
      0x38c2d6,
      0x303,
    ],
  };
  return ROM_CURVE_HIFIVE;
};

ROM_CURVE_NIST256 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_NIST256 = {
    // NIST256 Curve
    CURVE_Cof_I: 1,
    CURVE_A: -3,
    CURVE_B_I: 0,
    CURVE_B: [
      0xd2604b,
      0x3c3e27,
      0xf63bce,
      0xcc53b0,
      0x1d06b0,
      0x86bc65,
      0x557698,
      0xb3ebbd,
      0x3a93e7,
      0x35d8aa,
      0x5ac6,
    ],
    CURVE_Order: [
      0x632551,
      0xcac2fc,
      0x84f3b9,
      0xa7179e,
      0xe6faad,
      0xffffbc,
      0xffffff,
      0xffffff,
      0x0,
      0xffff00,
      0xffff,
    ],
    CURVE_Gx: [
      0x98c296,
      0x3945d8,
      0xa0f4a1,
      0x2deb33,
      0x37d81,
      0x40f277,
      0xe563a4,
      0xf8bce6,
      0x2c4247,
      0xd1f2e1,
      0x6b17,
    ],
    CURVE_Gy: [
      0xbf51f5,
      0x406837,
      0xcecbb6,
      0x6b315e,
      0xce3357,
      0x9e162b,
      0x4a7c0f,
      0x8ee7eb,
      0x1a7f9b,
      0x42e2fe,
      0x4fe3,
    ],
  };
  return ROM_CURVE_NIST256;
};

ROM_CURVE_NIST384 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_NIST384 = {
    // NIST384 curve
    CURVE_Cof_I: 1,
    CURVE_A: -3,
    CURVE_B_I: 0,
    CURVE_B: [
      0x6c2aef,
      0x11dba7,
      0x74aa17,
      0x51768c,
      0x6398d8,
      0x6b58ca,
      0x5404e1,
      0xa0447,
      0x411203,
      0x5dfd02,
      0x607671,
      0x4168c8,
      0x56be3f,
      0x1311c0,
      0xfb9f9,
      0x17d3f1,
      0xb331,
    ],
    CURVE_Order: [
      0x452973,
      0x32d599,
      0x6bb3b0,
      0x45853b,
      0x20db24,
      0x3beb03,
      0x7d0dcb,
      0x31a6c0,
      0x7fffc7,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0xffff,
    ],
    CURVE_Gx: [
      0x760ab7,
      0x3c70e4,
      0x30e951,
      0x7aa94b,
      0x2f25db,
      0x470aa0,
      0x20950a,
      0x7ba0f0,
      0x1b9859,
      0x45174f,
      0x3874ed,
      0x56ba3,
      0x71ef32,
      0x71d638,
      0x22c14d,
      0x65115f,
      0xaa87,
    ],
    CURVE_Gy: [
      0x6a0e5f,
      0x3af921,
      0x75e90c,
      0x6bf40c,
      0xb1ce1,
      0x18014c,
      0x6d7c2e,
      0x6d1889,
      0x147ce9,
      0x7a5134,
      0x63d076,
      0x16e14f,
      0xbf929,
      0x6bb3d3,
      0x98b1b,
      0x6f254b,
      0x3617,
    ],
  };
  return ROM_CURVE_NIST384;
};

ROM_CURVE_NIST521 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_NIST521 = {
    // NIST521 curve

    CURVE_Cof_I: 1,
    CURVE_A: -3,
    CURVE_B_I: 0,
    CURVE_B: [
      0x503f00,
      0x3fa8d6,
      0x47bd14,
      0x6961a7,
      0x3df883,
      0x60e6ae,
      0x4eec6f,
      0x29605e,
      0x137b16,
      0x23d8fd,
      0x5864e5,
      0x84f0a,
      0x1918ef,
      0x771691,
      0x6cc57c,
      0x392dcc,
      0x6ea2da,
      0x6d0a81,
      0x688682,
      0x50fc94,
      0x18e1c9,
      0x27d72c,
      0x1465,
    ],
    CURVE_Order: [
      0x386409,
      0x6e3d22,
      0x3aedbe,
      0x4ce23d,
      0x5c9b88,
      0x3a0776,
      0x3dc269,
      0x6600a4,
      0x166b7f,
      0x77e5f,
      0x461a1e,
      0x7fffd2,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fff,
    ],
    CURVE_Gx: [
      0x65bd66,
      0x7c6385,
      0x6fe5f9,
      0x2b5214,
      0xb3c18,
      0x1bc669,
      0x68bfea,
      0xee093,
      0x5928fe,
      0x6fdfce,
      0x52d79,
      0x69edd5,
      0x7606b4,
      0x3f0515,
      0x4fed48,
      0x409c82,
      0x429c64,
      0x472b68,
      0x7b2d98,
      0x4e6cf1,
      0x70404e,
      0x31c0d6,
      0x31a1,
    ],
    CURVE_Gy: [
      0x516650,
      0x28ed3f,
      0x222fa,
      0x139612,
      0x47086a,
      0x6c26a7,
      0x4feb41,
      0x285c80,
      0x2640c5,
      0x32bde8,
      0x5fb9ca,
      0x733164,
      0x517273,
      0x2f5f7,
      0x66d11a,
      0x2224ab,
      0x5998f5,
      0x58fa37,
      0x297ed0,
      0x22e4,
      0x9a3bc,
      0x252d4f,
      0x460e,
    ],
  };
  return ROM_CURVE_NIST521;
};

ROM_CURVE_NUMS256E = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_NUMS256E = {
    // NUMS256E Curve
    CURVE_Cof_I: 4,
    CURVE_A: 1,
    CURVE_B_I: -15342,
    CURVE_B: [
      0xffc355,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffff,
    ],
    CURVE_Order: [
      0xdd4af5,
      0xb190ee,
      0x9b1a47,
      0x2f5943,
      0x955aa5,
      0x41,
      0x0,
      0x0,
      0x0,
      0x0,
      0x4000,
    ],
    CURVE_Gx: [
      0xed13da,
      0xc0902e,
      0x86a0de,
      0xe30835,
      0x398a0e,
      0x9bd60c,
      0x5f6920,
      0xcd1e3d,
      0xea237d,
      0x14fb6a,
      0x8a75,
    ],
    CURVE_Gy: [
      0x8a89e6,
      0x16e779,
      0xd32fa6,
      0x10856e,
      0x5f61d8,
      0x801071,
      0xd9a64b,
      0xce9665,
      0xd925c7,
      0x3e9fd9,
      0x44d5,
    ],
  };
  return ROM_CURVE_NUMS256E;
};

ROM_CURVE_NUMS256W = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_NUMS256W = {
    // NUMS256W Curve
    CURVE_Cof_I: 1,
    CURVE_A: -3,
    CURVE_B_I: 152961,
    CURVE_B: [0x25581, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Order: [
      0x51a825,
      0x202947,
      0x6020ab,
      0xea265c,
      0x3c8275,
      0xffffe4,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffff,
    ],
    CURVE_Gx: [
      0x1aacb1,
      0xee1eb2,
      0x3abc52,
      0x3d4c7,
      0x579b09,
      0xcb0983,
      0xa04f42,
      0x297a95,
      0xaadb61,
      0xd6b65a,
      0xbc9e,
    ],
    CURVE_Gy: [
      0x84de9f,
      0xb9cb21,
      0xbb80b5,
      0x15310f,
      0x55c3d1,
      0xe035c9,
      0xf77e04,
      0x73448b,
      0x99b6a6,
      0xc0f133,
      0xd08f,
    ],
  };
  return ROM_CURVE_NUMS256W;
};

ROM_CURVE_NUMS384E = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_NUMS384E = {
    // NUMS384E Curve
    CURVE_Cof_I: 4,
    CURVE_A: 1,
    CURVE_B_I: -11556,
    CURVE_B: [
      0x7fd19f,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0xffff,
    ],
    CURVE_Order: [
      0x23897d,
      0x3989cd,
      0x6482e7,
      0x59ae43,
      0x4555aa,
      0x39ec3c,
      0x2d1af8,
      0x238d0e,
      0x7fffe2,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x3fff,
    ],
    CURVE_Gx: [
      0x206bde,
      0x1c8d8,
      0x4d4355,
      0x2a2ca0,
      0x292b16,
      0x680dfe,
      0x3ccc58,
      0x31ffd4,
      0x4c0057,
      0xdcb7c,
      0x4c2fd1,
      0x2aedad,
      0x2129ae,
      0x1816d4,
      0x6a499b,
      0x8fda2,
      0x61b1,
    ],
    CURVE_Gy: [
      0x729392,
      0x7c3e0,
      0x727634,
      0x376246,
      0x2b0f94,
      0x49600e,
      0x7d9165,
      0x7cc7b,
      0x5f5683,
      0x69e284,
      0x5ab609,
      0x86eb8,
      0x1a423b,
      0x10e716,
      0x69bbac,
      0x1f33dc,
      0x8298,
    ],
  };
  return ROM_CURVE_NUMS384E;
};

ROM_CURVE_NUMS384W = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_NUMS384W = {
    // NUMS384W Curve
    CURVE_Cof_I: 1,
    CURVE_A: -3,
    CURVE_B_I: -34568,
    CURVE_B: [
      0x7f77bb,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0xffff,
    ],
    CURVE_Order: [
      0xe61b9,
      0x3ecf6,
      0x698136,
      0x61bf13,
      0x29d3d4,
      0x1037db,
      0x3ad75a,
      0xf578f,
      0x7fffd6,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0xffff,
    ],
    CURVE_Gx: [
      0x18152a,
      0x740841,
      0x6fae72,
      0x7b0e23,
      0x6ed100,
      0x684a45,
      0x4a9b31,
      0x5e948d,
      0x79f4f3,
      0x1bf703,
      0x89707,
      0x2f8d30,
      0x222410,
      0x91019,
      0x5bc607,
      0x2b7858,
      0x7579,
    ],
    CURVE_Gy: [
      0x180716,
      0x71d8cc,
      0x1971d2,
      0x7fa569,
      0x6b4dbb,
      0x6fd79a,
      0x4486a0,
      0x1041be,
      0x739cb9,
      0x6ff0fe,
      0x4011a5,
      0x267bf5,
      0x530058,
      0x1afc67,
      0x66e38e,
      0x71b470,
      0xacde,
    ],
  };
  return ROM_CURVE_NUMS384W;
};

ROM_CURVE_NUMS512E = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_NUMS512E = {
    // NUMS512E Curve
    CURVE_Cof_I: 4,
    CURVE_A: 1,
    CURVE_B_I: -78296,
    CURVE_B: [
      0x7ecbef,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x3f,
    ],
    CURVE_Order: [
      0x6ed46d,
      0x19ea37,
      0x7d9d1a,
      0x6f7f67,
      0x605786,
      0x5ea548,
      0x5c2da1,
      0x1fec64,
      0x11ba9e,
      0x5a5f9f,
      0x53c18d,
      0x7ffffd,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0xf,
    ],
    CURVE_Gx: [
      0x6c57fe,
      0x565333,
      0x5716e6,
      0x662780,
      0x525427,
      0x15a1fc,
      0x15a241,
      0x5ee4c9,
      0x730f78,
      0x1ddc8c,
      0x188705,
      0x5c0a3a,
      0x6be273,
      0x44f42f,
      0x7128e0,
      0x73cfa6,
      0x332fd1,
      0x11a78a,
      0x632de2,
      0x34e3d0,
      0x5128db,
      0x71c62d,
      0x37,
    ],
    CURVE_Gy: [
      0x62f5e1,
      0x3d8183,
      0x7cc9b7,
      0x5f8e80,
      0x6d38a9,
      0x3fa04c,
      0xabb30,
      0xd0343,
      0x356260,
      0x65d32c,
      0x3294f,
      0x741a09,
      0x395909,
      0x55256d,
      0x96748,
      0x7b936c,
      0x6ee476,
      0x50544a,
      0x43d5de,
      0x538cc5,
      0x39d49c,
      0x2137fe,
      0x1b,
    ],
  };
  return ROM_CURVE_NUMS512E;
};

ROM_CURVE_NUMS512W = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_NUMS512W = {
    // NUMS512W Curve
    CURVE_Cof_I: 1,
    CURVE_A: -3,
    CURVE_B_I: 121243,
    CURVE_B: [
      0x1d99b,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
      0x0,
    ],
    CURVE_Order: [
      0x33555d,
      0x7e7208,
      0xf3854,
      0x3e692,
      0x68b366,
      0x38c76a,
      0x65f42f,
      0x612c76,
      0x31b4f,
      0x7729cf,
      0x6cf293,
      0x7ffffa,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x7fffff,
      0x3f,
    ],
    CURVE_Gx: [
      0x2bae57,
      0xf2b19,
      0xb720a,
      0x6b7aef,
      0x560137,
      0x3063ab,
      0x95585,
      0x3ca143,
      0x359e93,
      0x220ed6,
      0x408685,
      0x36cfca,
      0xc2530,
      0x28a0dc,
      0x407da1,
      0x6c1dda,
      0x5298ca,
      0x407a76,
      0x2dc00a,
      0x549ed1,
      0x7141d0,
      0x580688,
      0xe,
    ],
    CURVE_Gy: [
      0x3527a6,
      0xec070,
      0x248e82,
      0x67e87f,
      0x35c1e4,
      0x4059e5,
      0x2c9695,
      0x10d420,
      0x6de9c1,
      0x35161d,
      0xa1057,
      0xa78a5,
      0x60c7bd,
      0x11e964,
      0x6f2ee3,
      0x6def55,
      0x4b97,
      0x47d762,
      0x3bbb71,
      0x359e70,
      0x229ad5,
      0x74a99,
      0x25,
    ],
  };
  return ROM_CURVE_NUMS512W;
};

ROM_CURVE_SECP256K1 = function() {
  /* Fixed Data in ROM - Field and Curve parameters */

  var ROM_CURVE_SECP256K1 = {
    // SECP256K1 Curve
    // Base Bits= 24

    CURVE_Cof_I: 1,
    CURVE_A: 0,
    CURVE_B_I: 7,
    CURVE_B: [0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0],
    CURVE_Order: [
      0x364141,
      0x5e8cd0,
      0x3bbfd2,
      0xaf48a0,
      0xaedce6,
      0xfffeba,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffffff,
      0xffff,
    ],
    CURVE_Gx: [
      0xf81798,
      0x815b16,
      0xd959f2,
      0x2dce28,
      0x9bfcdb,
      0xb0702,
      0x95ce87,
      0x55a062,
      0xdcbbac,
      0x667ef9,
      0x79be,
    ],
    CURVE_Gy: [
      0x10d4b8,
      0xd08ffb,
      0x199c47,
      0xa68554,
      0x17b448,
      0x8a8fd,
      0xfc0e11,
      0x5da4fb,
      0xa3c465,
      0xda7726,
      0x483a,
    ],
  };
  return ROM_CURVE_SECP256K1;
};

// CommonJS module exports
if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
  module.exports.ROM_CURVE_ANSSI = ROM_CURVE_ANSSI;
  module.exports.ROM_CURVE_BLS383 = ROM_CURVE_BLS383;
  module.exports.ROM_CURVE_BLS24 = ROM_CURVE_BLS24;
  module.exports.ROM_CURVE_BLS48 = ROM_CURVE_BLS48;
  module.exports.ROM_CURVE_BLS381 = ROM_CURVE_BLS381;
  module.exports.ROM_CURVE_BLS461 = ROM_CURVE_BLS461;
  module.exports.ROM_CURVE_FP256BN = ROM_CURVE_FP256BN;
  module.exports.ROM_CURVE_FP512BN = ROM_CURVE_FP512BN;
  module.exports.ROM_CURVE_BN254 = ROM_CURVE_BN254;
  module.exports.ROM_CURVE_BN254CX = ROM_CURVE_BN254CX;
  module.exports.ROM_CURVE_BRAINPOOL = ROM_CURVE_BRAINPOOL;
  module.exports.ROM_CURVE_C25519 = ROM_CURVE_C25519;
  module.exports.ROM_CURVE_C41417 = ROM_CURVE_C41417;
  module.exports.ROM_CURVE_ED25519 = ROM_CURVE_ED25519;
  module.exports.ROM_CURVE_GOLDILOCKS = ROM_CURVE_GOLDILOCKS;
  module.exports.ROM_CURVE_HIFIVE = ROM_CURVE_HIFIVE;
  module.exports.ROM_CURVE_NIST256 = ROM_CURVE_NIST256;
  module.exports.ROM_CURVE_NIST384 = ROM_CURVE_NIST384;
  module.exports.ROM_CURVE_NIST521 = ROM_CURVE_NIST521;
  module.exports.ROM_CURVE_NUMS256E = ROM_CURVE_NUMS256E;
  module.exports.ROM_CURVE_NUMS256W = ROM_CURVE_NUMS256W;
  module.exports.ROM_CURVE_NUMS384E = ROM_CURVE_NUMS384E;
  module.exports.ROM_CURVE_NUMS384W = ROM_CURVE_NUMS384W;
  module.exports.ROM_CURVE_NUMS512E = ROM_CURVE_NUMS512E;
  module.exports.ROM_CURVE_NUMS512W = ROM_CURVE_NUMS512W;
  module.exports.ROM_CURVE_SECP256K1 = ROM_CURVE_SECP256K1;
}
